package com.bocloud.cmp.entity.resource;

import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;

import com.bocloud.common.utils.DateSerializer;
import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.IgnoreAll;
import com.bocloud.entity.annotations.IgnoreUpdate;
import com.bocloud.entity.annotations.PK;
import com.bocloud.entity.annotations.Table;
import com.bocloud.entity.bean.GenericEntity;
import com.bocloud.entity.meta.PKStrategy;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

/**
 * 云硬盘实体类
 * 
 * @author dongkai
 *
 */
@Table("volume")
public class Volume extends GenericEntity {

	@PK(value = PKStrategy.AUTO)
	private Long id; // ID
	@Column("volume_id")
	private String volumeId; // 快设备ID
	@Column("uuid")
	private String uuid; // UUID
	@Column("size")
	private Integer size; // 大小
	@Column("vendor_id")
	private Long vendorId; // 云供应商ID
	@IgnoreAll
	private String vendorName; // 云供应商名称
	@Column("region")
	private Long region; // 镜像所在区域
	@IgnoreAll
	private String regionName; // 镜像所在区域名称
	@Column("type")
	private String type; // 类型
	@Column("boot_volume")
	private Boolean bootVolume;// 是否是作为系统盘的云硬盘
	@Column("attached_time")
	@IgnoreUpdate
	@JsonSerialize(using = DateSerializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date attachedTime;// 挂载时间
	@Column("category")
	private String category;// 型号
	@Column("delete_auto_snapshot")
	private Boolean deleteAutoSnapshot;// 自动删除快照
	@Column("delete_with_instance")
	private Boolean deleteWithInstance;// 随实例删除
	@Column("enable_auto_snapshot")
	private Boolean enableAutoSnapshot;//
	@Column("detached_time")
	@IgnoreUpdate
	@JsonSerialize(using = DateSerializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date detachedTime;// 解挂时间
	@Column("image_id")
	private String imageId; // 镜像ID
	@Column("instance_id")
	private String instanceId;// 实例ID
	@Column("zone")
	private String zone; // 区域
	@Column("source_snapshot_id")
	private String sourceSnapshotId;// 原快照ID
	@Column("request_id")
	private String requestId;

	/**
	 * @return the requestId
	 */
	public String getRequestId() {
		return requestId;
	}

	/**
	 * @param requestId
	 *            the requestId to set
	 */
	public void setRequestId(String requestId) {
		this.requestId = requestId;
	}

	/**
	 * @return the type
	 */
	public String getType() {
		return type;
	}

	/**
	 * @param type
	 *            the type to set
	 */
	public void setType(String type) {
		this.type = type;
	}

	/**
	 * @return the bootVolume
	 */
	public Boolean getBootVolume() {
		return bootVolume;
	}

	/**
	 * @param bootVolume
	 *            the bootVolume to set
	 */
	public void setBootVolume(Boolean bootVolume) {
		this.bootVolume = bootVolume;
	}

	/**
	 * @return the attachedTime
	 */
	public Date getAttachedTime() {
		return attachedTime;
	}

	/**
	 * @param attachedTime
	 *            the attachedTime to set
	 */
	public void setAttachedTime(Date attachedTime) {
		this.attachedTime = attachedTime;
	}

	/**
	 * @return the category
	 */
	public String getCategory() {
		return category;
	}

	/**
	 * @param category
	 *            the category to set
	 */
	public void setCategory(String category) {
		this.category = category;
	}

	/**
	 * @return the deleteAutoSnapshot
	 */
	public Boolean getDeleteAutoSnapshot() {
		return deleteAutoSnapshot;
	}

	/**
	 * @param deleteAutoSnapshot
	 *            the deleteAutoSnapshot to set
	 */
	public void setDeleteAutoSnapshot(Boolean deleteAutoSnapshot) {
		this.deleteAutoSnapshot = deleteAutoSnapshot;
	}

	/**
	 * @return the deleteWithInstance
	 */
	public Boolean getDeleteWithInstance() {
		return deleteWithInstance;
	}

	/**
	 * @param deleteWithInstance
	 *            the deleteWithInstance to set
	 */
	public void setDeleteWithInstance(Boolean deleteWithInstance) {
		this.deleteWithInstance = deleteWithInstance;
	}

	/**
	 * @return the enableAutoSnapshot
	 */
	public Boolean getEnableAutoSnapshot() {
		return enableAutoSnapshot;
	}

	/**
	 * @param enableAutoSnapshot
	 *            the enableAutoSnapshot to set
	 */
	public void setEnableAutoSnapshot(Boolean enableAutoSnapshot) {
		this.enableAutoSnapshot = enableAutoSnapshot;
	}

	/**
	 * @return the detachedTime
	 */
	public Date getDetachedTime() {
		return detachedTime;
	}

	/**
	 * @param detachedTime
	 *            the detachedTime to set
	 */
	public void setDetachedTime(Date detachedTime) {
		this.detachedTime = detachedTime;
	}

	/**
	 * @return the imageId
	 */
	public String getImageId() {
		return imageId;
	}

	/**
	 * @param imageId
	 *            the imageId to set
	 */
	public void setImageId(String imageId) {
		this.imageId = imageId;
	}

	/**
	 * @return the instanceId
	 */
	public String getInstanceId() {
		return instanceId;
	}

	/**
	 * @param instanceId
	 *            the instanceId to set
	 */
	public void setInstanceId(String instanceId) {
		this.instanceId = instanceId;
	}

	/**
	 * @return the zone
	 */
	public String getZone() {
		return zone;
	}

	/**
	 * @param zone
	 *            the zone to set
	 */
	public void setZone(String zone) {
		this.zone = zone;
	}

	/**
	 * @return the sourceSnapshotId
	 */
	public String getSourceSnapshotId() {
		return sourceSnapshotId;
	}

	/**
	 * @param sourceSnapshotId
	 *            the sourceSnapshotId to set
	 */
	public void setSourceSnapshotId(String sourceSnapshotId) {
		this.sourceSnapshotId = sourceSnapshotId;
	}

	/**
	 * @return the vendorName
	 */
	public String getVendorName() {
		return vendorName;
	}

	/**
	 * @param vendorName
	 *            the vendorName to set
	 */
	public void setVendorName(String vendorName) {
		this.vendorName = vendorName;
	}

	/**
	 * @return the vendorId
	 */
	public Long getVendorId() {
		return vendorId;
	}

	/**
	 * @param vendorId
	 *            the vendorId to set
	 */
	public void setVendorId(Long vendorId) {
		this.vendorId = vendorId;
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return the volumeId
	 */
	public String getVolumeId() {
		return volumeId;
	}

	/**
	 * @param volumeId
	 *            the volumeId to set
	 */
	public void setVolumeId(String volumeId) {
		this.volumeId = volumeId;
	}

	/**
	 * @return the uuid
	 */
	public String getUuid() {
		return uuid;
	}

	/**
	 * @param uuid
	 *            the uuid to set
	 */
	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	/**
	 * @return the size
	 */
	public Integer getSize() {
		return size;
	}

	/**
	 * @param size
	 *            the size to set
	 */
	public void setSize(Integer size) {
		this.size = size;
	}

	/**
	 * @return the region
	 */
	public Long getRegion() {
		return region;
	}

	/**
	 * @param region
	 *            the region to set
	 */
	public void setRegion(Long region) {
		this.region = region;
	}

	/**
	 * @return the regionName
	 */
	public String getRegionName() {
		return regionName;
	}

	/**
	 * @param regionName
	 *            the regionName to set
	 */
	public void setRegionName(String regionName) {
		this.regionName = regionName;
	}

}
